package com.aces2win.client.widgets;

import com.aces2win.shared.beans.WalletBean;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Label;


public class WalletBackTestSummaryWidget extends Grid{
	public WalletBackTestSummaryWidget(WalletBean wb) {
		super(13,2);
		
		Label	balanceLabel = new Label("Balance :");
		Label	balanceValueLabel = new Label((new Double(wb.getBalance())).toString());
		Label	tradeNumberLabel = new Label("Number of trade");
		Label	tradeNumberValueLabel = new Label((new Integer(wb.getTradeNumber())).toString());
		Label	winningTradesLabel = new Label("Total winning trades");
		Label	winningTradesValueLabel = new Label((new Integer(wb.getWinningTrades())).toString());
		Label	losingTradesLabel = new Label("Total losing trades");
		Label	losingTradesValueLabel = new Label((new Integer(wb.getLosingTrades())).toString());
		Label	longTradeNumberLabel = new Label("Total long trades");
		Label	longTradeNumberValueLabel = new Label((new Integer(wb.getLongTradeNumber())).toString());
		Label	shortTradeNumberLabel = new Label("Total short trades");
		Label	shortTradeNumberValueLabel = new Label((new Integer(wb.getShortTradeNumber())).toString());
		Label	maxDrawDownLabel = new Label("Max drawdown");
		Label	maxDrawDownValueLabel = new Label((new Double(wb.getMaxDrawDown())).toString());
		Label	totalFeesLabel = new Label("Total fees");
		Label	totalFeesValueLabel = new Label((new Double(wb.getTotalFees())).toString());
		Label	longTradeProfitsLabel = new Label("Total profits when long");
		Label	longTradeProfitsValueLabel = new Label((new Double(wb.getLongTradeProfits())).toString());
		Label	shortTradeProfitsLabel = new Label("Total profits when short");
		Label	shortTradeProfitsValueLabel = new Label((new Double(wb.getShortTradeProfits())).toString());
		Label	consecutiveLossLabel = new Label("Consecutive Loss positions");
		Label	consecutiveLossValueLabel = new Label((new Integer(wb.getConsecutiveLoss())).toString());
		Label	consecutiveWinLabel = new Label("Consecutive Win positions");
		Label	consecutiveWinValueLabel = new Label((new Integer(wb.getConsecutiveWin())).toString());

		this.setWidget(0,0, balanceLabel);
		this.setWidget(1,0, tradeNumberLabel);
		this.setWidget(2,0, winningTradesLabel);
		this.setWidget(3,0, losingTradesLabel);
		this.setWidget(4,0, losingTradesLabel);
		this.setWidget(5,0, longTradeNumberLabel);
		this.setWidget(6,0, shortTradeNumberLabel);
		this.setWidget(7,0, maxDrawDownLabel);
		this.setWidget(8,0, totalFeesLabel);
		this.setWidget(9,0, longTradeProfitsLabel);
		this.setWidget(10,0, shortTradeProfitsLabel);
		this.setWidget(11,0, consecutiveLossLabel);
		this.setWidget(12,0, consecutiveWinLabel);
		
		this.setWidget(0,1, balanceValueLabel);
		this.setWidget(1,1, tradeNumberValueLabel);
		this.setWidget(2,1, winningTradesValueLabel);
		this.setWidget(3,1, losingTradesValueLabel);
		this.setWidget(4,1, losingTradesValueLabel);
		this.setWidget(5,1, longTradeNumberValueLabel);
		this.setWidget(6,1, shortTradeNumberValueLabel);
		this.setWidget(7,1, maxDrawDownValueLabel);
		this.setWidget(8,1, totalFeesValueLabel);
		this.setWidget(9,1, longTradeProfitsValueLabel);
		this.setWidget(10,1, shortTradeProfitsValueLabel);
		this.setWidget(11,1, consecutiveLossValueLabel);
		this.setWidget(12,1, consecutiveWinValueLabel);
		
	}
}
